package cn.appsys.service.back.appinfo;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.appsys.dao.back.appinfo.BackAppInfoMapper;
import cn.appsys.pojo.AppCategory;
import cn.appsys.pojo.AppInfo;
import cn.appsys.pojo.AppVersion;
import cn.appsys.pojo.DataDictionary;

@Service("backAppInfoService")
public class BackAppInfoServiceImpl implements BackAppInfoService {
	
	@Resource
	private BackAppInfoMapper backAppInfoMapper;
	
	@Override
	public List<AppInfo> queryAppInfo(String querySoftwareName,
			Integer queryFlatformId, Integer queryCategoryLevel1,
			Integer queryCategoryLevel2, Integer queryCategoryLevel3,
			Integer from, Integer pageSize) {
		return backAppInfoMapper.queryAppInfo(querySoftwareName, queryFlatformId,
				queryCategoryLevel1, queryCategoryLevel2, queryCategoryLevel3, from, pageSize);
	}

	@Override
	public int queryTotalCount(String querySoftwareName,
			Integer queryFlatformId, Integer queryCategoryLevel1,
			Integer queryCategoryLevel2, Integer queryCategoryLevel3) {
		return backAppInfoMapper.queryTotalCount(querySoftwareName, queryFlatformId,
				queryCategoryLevel1, queryCategoryLevel2, queryCategoryLevel3);
	}

	@Override
	public List<AppCategory> queryappCategoryList(Integer categoryId) {
		return backAppInfoMapper.queryappCategoryList(categoryId);
	}

	@Override
	public List<DataDictionary> queryAllFlatFrom(String typeCode) {
		return backAppInfoMapper.queryAllFlatFrom(typeCode);
	}

	@Override
	public AppInfo getAppInfo(Integer appId) {
		return backAppInfoMapper.getAppInfo(appId);
	}

	@Override
	public AppVersion getAppVersionById(Integer versionId) {
		return backAppInfoMapper.getAppVersionById(versionId);
	}

	@Override
	public boolean upStatus(Integer status, Integer id) {
		boolean isOk = false;
		if(backAppInfoMapper.upStatus(status, id) > 0){
			isOk = true;
		}
		return isOk;
	}
	
}
